import React from 'react';
import UrlForm from './UrlForm';
class EmptyComponent extends React.Component {
  render() {
    return <div />;
  }
}

const FormSkinEditor = React.forwardRef((props, ref) => {
  const { type, partId } = props.formData;
  let RenderComponent = null;
  switch (type) {
    case 'url':
      RenderComponent = UrlForm;
      break;
    default:
      RenderComponent = EmptyComponent;
      break;
  }
  return <RenderComponent ref={ref} partId={partId} {...props} />;
});

export default FormSkinEditor;
